package com.infore.siteManagement.controller.ddic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.entity.Basinn;
import com.infore.siteManagement.select.dto.QueryParamDto;
import com.infore.siteManagement.service.IBasinnService;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "流域管理接口", tags = {"流域管理接口" })
@RestController
@RequestMapping("/basinn")
public class BasinnController {

	@Autowired
	private IBasinnService iBasinnService;
	
	@ApiOperation(value = "查询流域通用接口")
	@ResponseBody
	@PostMapping(value = "/query")
	public ResultEntity queryBasinn(@RequestBody(required = false) QueryParamDto queryParamDto) {
		return iBasinnService.queryBasinn(queryParamDto);
	}
	
	@ApiOperation(value = "删除流域通用接口")
	@ApiImplicitParams(@ApiImplicitParam(value = "流域id", name = "ids", paramType = "query",required = true,dataType = "String"))
	@DeleteMapping(value = "/delete")
	public ResultEntity deleteBasinn(String ids) {
		return iBasinnService.deleteBasinn(ids);
	}
	
	@ApiOperation(value = "编辑/新增流域通用接口")
	@ResponseBody
	@PostMapping(value = "/edit")
	public ResultEntity editBasinn(@RequestBody Basinn basinn) {
		return iBasinnService.editBasinn(basinn);
	}
	
	@ApiOperation(value = "验证流域通用接口")
	@ResponseBody
	@PostMapping(value = "/validate")
	public ResultEntity validateBasinn(@RequestBody Basinn basinn) {
		return iBasinnService.validateBasinn(basinn);
	}
	
}
